<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head>


    <meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>Skinning a Chart Example</title>

<style type="text/css">
/*margin and padding on body element
  can introduce errors in determining
  element position and are not recommended;
  we turn them off as a foundation for YUI
  CSS treatments. */
body {
	margin:0;
	padding:0;
}
</style>

<link rel="stylesheet" type="text/css" href="../../build/fonts/fonts-min.css" />
<script type="text/javascript" src="../../build/yahoo-dom-event/yahoo-dom-event.js"></script>
<script type="text/javascript" src="../../build/json/json-min.js"></script>
<script type="text/javascript" src="../../build/element/element-min.js"></script>
<script type="text/javascript" src="../../build/datasource/datasource-min.js"></script>
<script type="text/javascript" src="../../build/swf/swf-min.js"></script>
<script type="text/javascript" src="../../build/charts/charts-min.js"></script>


<!--begin custom header content for this example-->
<style type="text/css">
	#chart
	{
		width: 580px;
		height: 400px;
	}
	
	.chart_title
	{
		display: block;
		font-size: 1.2em;
		font-weight: bold;
		margin-bottom: 0.4em;
	}
</style>
<!--end custom header content for this example-->

</head>

<body class="yui-skin-sam">


<h1>Skinning a Chart Example</h1>

<div class="exampleIntro">
	<p>This example demonstrates how to modify the <a href="http://developer.yahoo.com/yui/charts/">YUI Charts Control</a>'s styles to give it a custom appearance.</p>
<p>Please note: The YUI Charts Control requires Flash Player 9.0.45 or higher. The latest version of Flash Player is available at the <a href="http://www.adobe.com/go/getflashplayer">Adobe Flash Player Download Center</a>.</p>			
</div>

<!--BEGIN SOURCE CODE FOR EXAMPLE =============================== -->

<span class="chart_title">Wilson's Supermarket - Product Comparison</span>
<div id="chart">Unable to load Flash content. The YUI Charts Control requires Flash Player 9.0.45 or higher. You can download the latest version of Flash Player from the <a href="http://www.adobe.com/go/getflashplayer">Adobe Flash Player Download Center</a>.</p></div>

<script type="text/javascript">

	YAHOO.widget.Chart.SWFURL = "../../build/charts/assets/charts.swf";

//--- data

	YAHOO.example.salesComparison =
	[
		{ month: "Oct", pork: 1354, beef: 1442 },
		{ month: "Nov", pork: 1326, beef: 1496 },
		{ month: "Dec", pork: 1292, beef: 1582 },
		{ month: "Jan", pork: 1387, beef: 1597 },
		{ month: "Feb", pork: 1376, beef: 1603 }
	];

	var salesData = new YAHOO.util.DataSource( YAHOO.example.salesComparison );
	salesData.responseType = YAHOO.util.DataSource.TYPE_JSARRAY;
	salesData.responseSchema = { fields: [ "month", "pork", "beef" ] };

//--- chart

	var seriesDef =
	[
		{
			yField: "pork",
			displayName: "Sales of Pork",
			style:
			{
				image: "assets/tube.png",
				mode: "no-repeat",
				color: 0x2e434d,
				size: 40
			}
		},
		{
			yField: "beef",
			displayName: "Sales of Beef",
			style:
			{
				image: "assets/tube.png",
				mode: "no-repeat",
				color: 0xc2d81e,
				size: 40
			}
		}
	];

	var mychart = new YAHOO.widget.ColumnChart( "chart", salesData,
	{
		series: seriesDef,
		xField: "month",
		style:
		{
			border: {color: 0x96acb4, size: 12},
			font: {name: "Arial Black", size: 14, color: 0x586b71},
			dataTip:
			{
				border: {color: 0x2e434d, size: 2},
				font: {name: "Arial Black", size: 13, color: 0x586b71}
			},
			xAxis:
			{
				color: 0x2e434d
			},
			yAxis:
			{
				color: 0x2e434d,
				majorTicks: {color: 0x2e434d, length: 4},
				minorTicks: {color: 0x2e434d, length: 2},
				majorGridLines: {size: 0}
			}
		}
	});
</script>

<!--END SOURCE CODE FOR EXAMPLE =============================== -->

</body>
</html>
